package com.hydl.power.service;

import com.github.pagehelper.PageInfo;
import com.hydl.power.pojo.*;

import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author wxb
 * @date 2020/3/31 15:08
 */
public interface WorkOrderService {

    /**
     * 工单派送列表
     * @param pageNum
     * @param pageSize
     * @param beginTime
     * @param endTime
     * @param orderTypes
     * @param rank
     * @return
     */
    PageInfo<WorkOrder> getAllWorkOrderByList(Integer pageNum, Integer pageSize, Long beginTime, Long endTime, Integer orderTypes, Integer rank, Integer orderStatus);


    PageInfo<WorkOrder> getAllWorkOrderTwo(Integer pageNum, Integer pageSize, String begin, String end, Integer orderStatus, Integer maintainerId, String areaId, String projectId, String roomId);

    /**
     * 事件记录 告警列表
     * @param pageNum
     * @param pageSize
     * @param begin
     * @param end
     * @param rank
     * @param faultTypes
     * @param orderStatus
     * @param roomName
     * @param deviceName
     * @param deviceAddress
     * @return
     */
    PageInfo<WorkOrder> getIncidentRecord(Integer pageNum, Integer pageSize, Long begin, Long end, Integer rank, Integer faultTypes, Integer orderStatus,
                                              String roomName, String deviceName, String deviceAddress, String token);

    /**
     * 获取区域
     * @return
     */
    List<OrderDeliveryMenu> getAllByPId();

    /**
     * 获取单位/配电房
     * @param pId
     * @return
     */
    List<OrderDeliveryMenu> getAllByPIds(String pId);

    List<WorkOrder> getList();

    int updateOrderStatusById(Integer id, Integer orderStatus);

    WorkOrder getById(Integer id);



    //Set<WorkOrderMenu> getWorkOrderMenu();
    ArrayList<OrderDeliveryMenu> getTree();



    List<Maintainer> getMaintainer(String powerroomId);

    //分配运维人员
    int updateMaintainer(String maintainerId, String WorkOrderId, String projectName, String roomName, String deviceName, String phone) throws MalformedURLException, UnsupportedEncodingException;


    /* 按设备id 查询报警信息*/
    List<OpsReport> queryByDeviceId(String deviceId);

    List<WorkOrder> getWorkOrderByProjectId(String projectId);

    WorkOrder getWorkOrderByOrderDeliveryId(String orderDeliveryId);
}
